#include "../../Server.hpp"

int main()
{
    TcpSocket client_socket;
    client_socket.ClientCreate("127.0.0.1", 8080);
    std::string msg = "hello test test test 123";
    //先发五次
    for(int i = 0;i < 5;i++)
    {
        client_socket.Send((void *)msg.c_str(), msg.size());    
        char recv_buffer[1024] = {0};
        int ret = client_socket.Recv(recv_buffer, sizeof(Buffer) - 1);
        if (ret < 0)
        {
            client_socket.Close();
        }
        else
        {
            std::cout << recv_buffer << std::endl;
        }
        sleep(1);
    }
    //死循环观察是否会超时断开连接
    while(1) sleep(1);
}